<template>
	<view class="content1 flex flex-col justify-start">
		<view class="flex flex-row top w100 justify-start items-center  ">
			<image src="../../static/image/danghuiicon@2x.png" mode="widthFix" style="width: 36rpx;"></image>
			<view class="name f_36 c_3d ml10">建湖县塘河街道严桥村党总支</view>
		</view>
		<view class="colle1">
			<view class="flex flex-col w100">
				<view class="flex flex-col justify-start items-start item1" v-for="(item,index) in list" :key="index" @click="show(item,index)">
					<view class="daitem flex flex-row justify-between items-center w100">
						<text class="f_32 c_3d xian">{{item.area}}</text>
						<i class="iconfont icon-sjt c_80 f_28" v-if="item.show==true"></i>
						<i class="iconfont icon-jiantoushang c_80 f_28"  v-else ></i>
					</view>
					<view class="flex flex-col justify-start infolist mt10" v-for="(item1,index1) in item.list" :key="index1"  v-if="item.show">
						<view class="flex flex-row justify-start items-center">
							<view class="quan" style="width: 16rpx;height: 16rpx; background-color:#0256FFFF; margin-left: 30rpx; margin-right: 30rpx;border-radius: 50%;"></view>
							<view class="name flex flex-row justify-start f_28 c_3d" style="width: 150rpx;">
								{{item1.titile}}
							</view>
							<view class="sex" style="width: 80rpx;">{{item1.general}}</view>
							<view class="zu" style="width: 80rpx;">{{item1.type}}</view>
							<view class="zu" style="width: 300rpx; text-align: right;">
							<text class="f_28 c_9" style="margin-right: 8rpx;">手机</text>
							{{item1.mobile}}</view>
						</view>
						
							<view class="flex flex-row justify-start items-center infolist mt10">
								<view class="quan" style="width: 16rpx;height: 16rpx; background-color:#fff;margin-left: 30rpx; margin-right: 30rpx;border-radius: 50%;"></view>
						<view class="name flex flex-row justify-start f_28 c_3d" style="width: 300rpx;">
						 <text class="f_28 c_9" style="margin-right: 8rpx;">出生年月</text>{{item1.birthday}}
						</view>
						
						<view class="zu" style="width: 310rpx; text-align: right;"><text class="f_28 c_9" style="margin-right: 8rpx;">入党时间</text>
							{{item1.jiondate}}</view>
							</view>
					</view>
					
				</view>
			</view>
			
		
		</view>
		
	</view>
</template>

<script>
	import {
		getFormatDate,
		getFormatDatenow
	} from "@/common/js/util.js";

	import http from 'common/js/http.js';

	export default {
		 
		mixins: [http],
		data() {

			const [year, month, date] = getFormatDate().split("-");
			const [year1, month2, date2, hour2, minute2, second2] = getFormatDatenow().split("-");
			return {
				type:'',
				list:[
					
				
				]
				
			}
		},
		onLoad(data) {
		if(data.id=='1'){
			this.type = '正式'
			uni.setNavigationBarTitle({
				title:'党员信息'
			})
		}else{
			this.type = '流动'
			uni.setNavigationBarTitle({
				title:'流动党员'
			})
		}
		},
		onShow() {
		this.getlist()
		},
		methods: {
			getlist(){
				this.sendRequest({
					url: 'cun/partymemberlist',
					data: {
						town_id: 1,
						type:this.type
					},
					success: res => {
						console.log(res)
						if (res.code > 0) {
				res.data.map(item=>{
					item.show = false
				})
							this.list = res.data
							this.list[0].show=true
						}
					}
				})
			},
			
		show(item,index){
			let a = item.show
			this.list.map(e=>{
				e.show=false
			})
			this.list[index].show=!a
		},
			getbanner() {
				this.sendRequest({
					url: 'cun/block',
					data: {
						town_id: 1
					},
					success: res => {
						console.log(res)
						if (res.code > 0) {
							
							this.list = res.data
						}
					}
				})
			},
			
		
		
		}
	}
</script>

<style lang="scss">
	.infolist{
		padding: 20rpx 0;
		padding-top: 0;
		padding-bottom: 10rpx;
		width: 100%;
	}
	.xian{
		
		padding-left: 20rpx;
		position: relative;
	}
	
	.xian::before{
		position: absolute;
		left: 0;
		top:50%;
		margin-top: -15rpx;
		width: 6rpx;
		height: 30rpx;
		background-color: #0256FFFF;
		content: '';
		
	}
	.colle1{
		padding:20rpx;
		
		padding-top: 0;
		background-color: #fff;
		
	}
	
.top{
	padding: 40rpx;
	background-color: #fff;
	border-bottom: 1rpx solid #F9F9F9;
}
	page {
		background: #F9F9F9;
	}

	.item1{
		padding: 20rpx 0;
		border-bottom: 1rpx solid #f9f9f9;
	}
</style>